<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>管理员信息添加</title>
    <link rel="stylesheet" type="text/css" th:href="@{/css/admin_index.css}">
</head>
<body>

<div class="frm">
    <div class="title">管理员信息添加:</div>
    <form th:action="@{/admin/add}" enctype="multipart/form-data" method="post">
        <table>

            <tr>
                <td>管理员名:</td>
                <td>
                    <input type="text" name="username" required="required"/>
                </td>
            </tr>

            <tr>
                <td>密码:</td>
                <td>
                    <input type="text" id="password" name="password" required="required" th:onblur="|pwdToMd5()|"/>
                </td>
            </tr>

            <tr>
                <td>
                    <input type="submit" value="提交">
                </td>
            </tr>
        </table>
    </form>
</div>

<script src="dist/js/jquery.min.js" th:src="@{/dist/js/jquery.min.js}"></script>
<script th:src="@{/js/md5.js}"></script>
<script type="text/javascript">
    function pwdToMd5() {
        // 如果密码被更改了，那就重新加密
        var password = hex_md5(document.getElementById("password").value);
        $("#password").val(password);
    }
</script>
</body>
</html>